#ifndef MOUSELISTENER_HPP
#define MOUSELISTENER_HPP

/********************************************************************
	created:	2011/01/17
	filename: 	E:\C++\Red\src\Graphics\MouseListener.hpp
	author:		Red
	
	purpose:	Mouse Events listener
*********************************************************************/

#include "Listener.hpp"

namespace red {
	/// SFML Mouse callback specialised Listener
	class REDAPI MouseListener : public Listener{
	public:
		MouseListener() {
			mType = LT_Mouse;	
		}

		/// Callable function which send the received event in the right callback
		/// @param pEvent : Received Event
		virtual void OnEvent(const sf::Event &pEvent) {
			switch(pEvent.Type){
			case sf::Event::MouseWheelMoved:
				OnMouseWheelMoved(pEvent.MouseWheel);
				break;
			case sf::Event::MouseButtonPressed:
				OnMouseButtonPressed(pEvent.MouseButton);
				break;
			case sf::Event::MouseButtonReleased:
				OnMouseButtonReleased(pEvent.MouseButton);
				break;
			case sf::Event::MouseMoved:
				OnMouseMoved(pEvent.MouseMove);
				break;
			case sf::Event::MouseEntered:
				OnMouseEntered(pEvent.MouseMove);
				break;
			case sf::Event::MouseLeft:
				OnMouseLeft(pEvent.MouseMove);
				break;
			default:
				break;
			}
		}

	protected:
		// Overloadable functions for an inherited class
			/// Mouse Event : sf::MouseWheelMoved
			virtual void OnMouseWheelMoved(const sf::Event::MouseWheelEvent &pEvent) {}

			/// Mouse Event : sf::MouseButtonPressed
			virtual void OnMouseButtonPressed(const sf::Event::MouseButtonEvent &pEvent) {}

			/// Mouse Event : sf::MouseButtonReleased
			virtual void OnMouseButtonReleased(const sf::Event::MouseButtonEvent &pEvent) {}

			/// Mouse Event : sf::MouseMoved
			virtual void OnMouseMoved(const sf::Event::MouseMoveEvent &pEvent) {}

			/// Mouse Event : sf::MouseEntered
			virtual void OnMouseEntered(const sf::Event::MouseMoveEvent &pEvent) {}

			/// Mouse Event : sf::MouseLeft
			virtual void OnMouseLeft(const sf::Event::MouseMoveEvent &pEvent) {}
	};

	typedef std::vector<MouseListener*> MouseListenerList;
}

#endif // MOUSELISTENER_HPP